import React from "react";
import Mask from '../../../components/Mask/Mask'
import DialogContent from './DialogContent'

type P = {
    message?: string;
}

type S = {
    show: boolean;
}

export default class ShowDialog extends React.Component<P, S> {
    static defaultProps = {
        message: 'ShowDialog'
    }
    constructor(props: P) {
        super(props)
        this.state = {
            show: false
        }
    }
    close = () => {
        this.setState({ show: false })
    }
    openDialog = () => {
        this.setState({ show: true })
    }
    render() {
        const { show } = this.state
        return (
            <div>
                <Mask close={this.close} show={show} >
                    <DialogContent />
                </Mask>
                <button onClick={this.openDialog}>点击显示弹窗</button>
            </div >
        )
    }
}